package com.oriental.manage.controller.specially;

import com.oriental.riskfront.api.service.CommLoginInterface;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by zhuhui on 2017/4/26.
 */
@Slf4j
@Controller
@RequestMapping("riskUserLogin")
public class RiskUserLoginController {

    @Autowired
    private CommLoginInterface commLoginInterface;
    /**
     * 登录入口
     * @return
     */
    @RequestMapping("userLogin/init")
    public String userLogin(){
        return "specially/commLogin";
    }
    @RequestMapping(value = "userLogin/userLoginGo",produces = "text/plain;charset=UTF-8")
    @ResponseBody
    public String userLoginGo(){
        String code = commLoginInterface.riskLogin();
        //String code ="登录";
        log.info("登录---:"+code);
        String token = commLoginInterface.getUserToken();
        return code;
    }
    @RequestMapping(value = "userLogin/userLogout",produces = "text/plain;charset=UTF-8")
    @ResponseBody
    public String userLogout(){
        //String code ="登出";
        String code = commLoginInterface.riskLogout();
        log.info("登出---:"+code);
        return code;
    }
}
